#!/bin/bash
set -ex
export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH"
ARCH="$($SNAP/bin/uname -m)"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/$ARCH-linux-gnu:$SNAP/usr/lib/$ARCH-linux-gnu"
export LD_LIBRARY_PATH=$SNAP_LIBRARY_PATH:$LD_LIBRARY_PATH

if [ -e ${SNAP_DATA}/var/lock/lite.lock ]
then
  echo "Will not run along with kubelite"
  exit 0
else
  echo "Service should not be running. This is a single binary snap"
  exit 1
fi
